package com.iron.visual.minio;

import com.iron.common.swagger.annotation.EnableIronSwagger2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.SpringCloudApplication;

import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;
import java.util.stream.Stream;

@EnableIronSwagger2
@SpringCloudApplication
public class IronMinioApplication {

    public static void main(String[] args) {
//        SpringApplication.run(IronMinioApplication.class, args);
        int count = IntStream.iterate(1, e -> e + 3)
                .takeWhile(i -> i <= 100)
                .sum();
        System.out.println(count);
    }

}
class Sample {
    public static int simulateTimeConsumingComputation(int number) {
        try { Thread.sleep(1000); } catch(Exception ex) {}
        return number * 2;
    }

    public static void main(String[] args) {
        List<Integer> numbers = Arrays.asList(1, 2, 3);

        int[] factor = new int[] { 2 };
        Stream<Integer> stream = numbers.stream()
                .map(e -> e * factor[0]);

        factor[0] = 0;

        stream.forEach(System.out::println);
    }
}